<?php
$msg = $_POST["msgText"];
$fname = $_POST["msgFile"];
$file = fopen($fname,"w");
if (!$file) die ("cannot open the file");
fwrite($file, $msg);
fclose($file);
echo "&msg=The book has been successfully been saved&result=no error";	
?>
